﻿@using GoodMan.Infrastructure.Entities.Entity;
@{
    ViewBag.Title = "限时特卖";
    Layout = "~/Areas/WorkSpace/Views/Shared/_CollegeAdminTemplete.cshtml";
    ItemListBox<Product> data = ViewBag.Data;
    
    string SearchKey = ViewBag.SearchKey;
}
<div id="content-header">
    <h1>
        限时特卖</h1>
</div>
<div id="breadcrumb">
    <a href="index.html" title="Go to Home" class="tip-bottom"><i class="icon-home"></i>
        首页</a> <a href="#" class="tip-bottom">商品管理</a> <a href="#" class="current">限时特卖</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-th"></i></span>
                    <h5>
                        限时特卖</h5>
                </div>
                <div class="widget-content nopadding">
                    <form action="/CollegeAdmin/SearchSpecialSaleProducts" method="post" class="form-horizontal">
                    <table border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td style="width:20%">
                                 &nbsp;
                            </td>
                            <td style="width:40%">
                                <div class="control-group">
                                    <label class="control-label">
                                        商品关键字</label>
                                    <div class="controls">
                                        <input type="text" value="@SearchKey" name="ProductKey" style="width: 80%" />
                                    </div>
                                </div>
                            </td>
                            <td style="width:20%">
                                <div class="controls" style="margin-left: 30px;">
                                    <button class="btn btn-primary">
                                        <i class="icon-search icon-white"></i>查询</button>
                                </div>
                            </td>
                        </tr>
                        <tr>
                        <td colspan="3">
                        <table class="table table-bordered  table-striped">
									<thead>
									<tr>
									<th width="10%">货号</th>
									<th width="29%">名称</th>
									<th  width="8%">图片</th>
                                    <th  width="10%">购入价格</th>
                                    <th  width="10%">默认售价</th>
                                    <th  width="10%">最新特卖</th>
                                    <th  width="8%">状态</th>
                                     <th  width="15%">操作</th>
									</tr>
									</thead>
									<tbody>
									@{
                             if (data != null && data.Data != null && data.Data.Any())
                              {
                                      
                                    foreach (var item in data.Data)
                                    {
                                        
                                        <tr>
                                            <td  style="vertical-align:middle">
                                               @item.ProductCode
                                            </td>
                                            <td  style="vertical-align:middle">
                                               <a href="../../Shop/ProductItemView?Id=@item.Id" target="_blank" ><span title="@item.ProductName">@item.ProductName</span></a>
                                            </td>
                                            <td  style="vertical-align:middle">
                                                <img alt="图片" src="@item.Images" />
                                            </td>
                                            
                                            <td  style="vertical-align:middle">
                                                @item.PurchasePrice
                                            </td>
                                            <td  style="vertical-align:middle">
                                                @item.DefaulSalePrice
                                            </td>
                                            <td  style="vertical-align:middle">
                                                @item.PolicyPrice
                                            </td>
                                
                                            <td  style="vertical-align:middle">
                                                <span title="时间：@item.StartDate-@item.EndDate">@item.StateStr</span>
                                            </td>
                                 
                                            <td class="center" style="vertical-align:middle"><a href="/workspace/CollegeAdmin/ProductSpecialSaleDetail?productId=@item.Id&type=1" class="btn btn-primary btn-mini" style="margin-top:10px">设置</a> <a onclick='return confirm("确定要删除吗?")' href="/workspace/CollegeAdmin/DeleteSpecialProduct?productId=@item.Id&page=@data.CurrentPage&productkey=@SearchKey" class="btn btn-danger btn-mini"  style="margin-top:10px">删除</a>
                                            </td>
                                        </tr>
                                    }
                              }
                              else
                              {
                                  <tr>
                                    <td colspan="10" align="center">
                                        无限时特卖商品数据，请在普通商品列表添加
                                    </td>
                                </tr>  
                              }
                        }
									</tbody>
									</table>  
                        </td>
                        </tr>
                    </table>
                    </form>
                </div>
                @Html.Raw(data.PageItemSegment)
            </div>
        </div>
    </div>
</div>
@section tail{
<script type="text/javascript">
    $(function () {
        $('#likProduct').addClass('open');
        $('#likProduct').addClass('active');
    });
</script>
